package com.nf.service;

import com.nf.entity.WarnWeathers;
import com.nf.mapper.WarnWeathersMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

@Service
public class WarnWeathersServiceImpl implements WarnWeathersService {

    @Autowired
    private WarnWeathersMapper mapper;

    @Override
    public List<WarnWeathers> getAllWarnWeathers() {
        return mapper.getAllWarnWeathers();
    }

    @Override
    @Transactional
    public boolean delWarnWeathersByIds(int[] ids) {
//        List<Integer> idList = new ArrayList<>();
//        for (int id:ids) {
//            System.out.println("删除id："+id);
//            idList.add(id);
//        }

        return mapper.delWarnWeathersByIds(ids);
    }

    @Override
    @Transactional
    public boolean addWarnWeathers(WarnWeathers warnWeathers) {
        return mapper.addWarnWeathers(warnWeathers);
    }
}
